﻿/// <reference path="../jquery-1.4.4-vsdoc.js" />

$.fn.form = function ()
{
    var data = new Object();

    this.find("input,textarea,select").filter("[name]").each(function ()
    {
        if ($(this).attr("type").toString().toLowerCase() == "radio")
        {
            if ($(this).filter(":checked").length)
                data[$(this).attr("name")] = $(this).val();
        } else
            data[$(this).attr("name")] = $(this).val();
    });

    return data;
}